<template>
  <DataList :cate="cate" :single="true" :cols="cols" :name="name" />
</template>
<script>
import DataList from "@/components/DataList";
import { getUser } from "@/utils/auth";
import { addFztyjr, deleteFztyjr, updateFztyjr, getFztyjr } from "@/api/复转军人退役军人情况.js";
export default {
  components: {
    DataList
  },
  data() {
    return {
      cate: "A11-3复转军人、退役军人情况",
      name:'11.3 复转军人、退役军人情况',
      cols: [
        { label: "当年招生人数(人)", prop: "DNZS" ,data:[
            {label:'合计',prop:'DNZSHJ'},
            { label: "复转军人", prop: "DNZSFZJR" },
            { label: "退役士兵177", prop: "DNZSTYSB" },
        ]},
        { label: "在校人数(人)", prop: "ZX" ,data:[
            {label:'合计',prop:'ZXHJ'},
            { label: "复转军人", prop: "ZXFZJR" },
            { label: "退役士兵177", prop: "ZXTYSB" },
        ]},
        { label: "社会培训(人天)", prop: "SHPX" ,data:[
            {label:'合计',prop:'SHPXHJ'},
            { label: "复转军人", prop: "SHPXFZJR" },
            { label: "退役士兵177", prop: "SHPXTYSB" },
        ]},
      ]
    };
  },
  methods: {
  
    onadd(model) {
      //
      var temp = JSON.parse(JSON.stringify(model))
      return new Promise(async (resolve,reject)=>{
           
      
          console.log(JSON.stringify(temp));
          var model = await addFztyjr(temp);
          resolve(model);
      })
      
    },
    onupdate(model) {
      //
      var temp = JSON.parse(JSON.stringify(model))
      return new Promise(async (resolve,reject)=>{
           
          console.log(JSON.stringify(temp));
          var model = await updateFztyjr(temp);
          resolve(model);
      })
      //
    },
    ondelete(model) {
       var temp = JSON.parse(JSON.stringify(model))
      return new Promise(async (resolve,reject)=>{
        
         await deleteFztyjr(temp);
          resolve();
      })
    },
    async fetchData() {
      var user = getUser();
      var datas = await getFztyjr(user.XXID,user.CJPC);
      return datas;
    }
  }
};
</script>
<style>
</style>